package com.eascs.afterloan.dao;

import org.springframework.stereotype.Repository;

import com.eascs.admin.common.dao.BaseO2oDao;
import com.eascs.afterloan.form.RefundPrintForm;

@Repository
public class RefundPrintDao extends BaseO2oDao{
	
	public RefundPrintForm findByCode(String billCode){
		String sql = "SELECT l.instrument_number AS instrumentNumber, lu.user_full_name AS userFullName, lu.document_type AS documentType, lu.document_no AS documentNo FROM o2o_loanapply l LEFT JOIN o2o_loan_user lu ON l.loan_id = lu.loan_id AND l.loanapply_no = lu.loanapply_no AND lu.spouse_id IS NULL AND lu.sponsor_type IS NULL WHERE l.bill_code = ?";
		return this.findEntity(sql, RefundPrintForm.class, billCode);
	}
	
}
